package com.springboot.redis.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.springboot.redis.dao.RedisDao;

@RestController
@RequestMapping("/redis")
public class RedisController {
	public static Logger logger= LoggerFactory.getLogger(RedisController.class);
	private RedisDao redisDao;
	@Autowired
	public void setRedisDao(RedisDao redisDao) {
		this.redisDao = redisDao;
	}
	
	@RequestMapping(value = "/set", method = RequestMethod.GET)
    public void set() {
		redisDao.setKey("csdn", "传智播客");
		logger.info("redis 取值：" + redisDao.getValue("csdn"));
    }

	
	

}
